# Maintainer: Willow Barraco <contact@willowbarraco.fr>
pkgname=phpactor
pkgver=2024.06.30.0
pkgrel=0
pkgdesc="PHP Language Server with more features"
url="https://github.com/phpactor/phpactor"
arch="noarch"
license="MIT"
_phpv=83
_php=php$_phpv
_composer="$_php -d memory_limit=512M /usr/bin/composer.phar"
makedepends="
	$_php
	$_php-phar
	$_php-openssl
	composer
"
depends="
	$_php
	$_php-mbstring
	$_php-tokenizer
"
options="!check net" # no tests
source="
	$pkgname-$pkgver.tar.gz::https://github.com/phpactor/phpactor/archive/refs/tags/$pkgver.tar.gz
	"

build() {
	$_composer install --no-interaction --no-dev --optimize-autoloader
}

package() {
	mkdir -p "$pkgdir/usr/share/webapps/$pkgname" "$pkgdir"/usr/bin
	cp -r ./ "$pkgdir/usr/share/webapps/$pkgname"
	ln -s /usr/share/webapps/phpactor/bin/phpactor "$pkgdir"/usr/bin/phpactor
}

sha512sums="
d25dbb3b92e611dd14043fa5c607c7e66b3a3afcbe88ff303a502f6745ab59da85727238c92f9c532ab4e07c7b75742a64622edbbe7d287febdfa1a49ef8d52c  phpactor-2024.06.30.0.tar.gz
"
